package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhElectricInstallMapper;
import com.ruoyi.zsyh.domain.ZsyhElectricInstall;
import com.ruoyi.zsyh.service.IZsyhElectricInstallService;
import com.ruoyi.common.core.text.Convert;

/**
 * 空调安装登记Service业务层处理
 * 
 * @author yuexl
 * @date 2023-05-17
 */
@Service
public class ZsyhElectricInstallServiceImpl implements IZsyhElectricInstallService 
{
    @Autowired
    private ZsyhElectricInstallMapper zsyhElectricInstallMapper;

    /**
     * 查询空调安装登记
     * 
     * @param id 空调安装登记ID
     * @return 空调安装登记
     */
    @Override
    public ZsyhElectricInstall selectZsyhElectricInstallById(String id)
    {
        return zsyhElectricInstallMapper.selectZsyhElectricInstallById(id);
    }

    /**
     * 查询空调安装登记列表
     * 
     * @param zsyhElectricInstall 空调安装登记
     * @return 空调安装登记
     */
    @Override
    public List<ZsyhElectricInstall> selectZsyhElectricInstallList(ZsyhElectricInstall zsyhElectricInstall)
    {
        return zsyhElectricInstallMapper.selectZsyhElectricInstallList(zsyhElectricInstall);
    }

    /**
     * 新增空调安装登记
     * 
     * @param zsyhElectricInstall 空调安装登记
     * @return 结果
     */
    @Override
    public int insertZsyhElectricInstall(ZsyhElectricInstall zsyhElectricInstall)
    {
        zsyhElectricInstall.setCreateTime(DateUtils.getNowDate());
        zsyhElectricInstall.setId(IdWorker.getId());
        return zsyhElectricInstallMapper.insertZsyhElectricInstall(zsyhElectricInstall);
    }

    /**
     * 修改空调安装登记
     * 
     * @param zsyhElectricInstall 空调安装登记
     * @return 结果
     */
    @Override
    public int updateZsyhElectricInstall(ZsyhElectricInstall zsyhElectricInstall)
    {
        zsyhElectricInstall.setUpdateTime(DateUtils.getNowDate());
        return zsyhElectricInstallMapper.updateZsyhElectricInstall(zsyhElectricInstall);
    }

    /**
     * 删除空调安装登记对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhElectricInstallByIds(String ids)
    {
        return zsyhElectricInstallMapper.deleteZsyhElectricInstallByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除空调安装登记信息
     * 
     * @param id 空调安装登记ID
     * @return 结果
     */
    @Override
    public int deleteZsyhElectricInstallById(String id)
    {
        return zsyhElectricInstallMapper.deleteZsyhElectricInstallById(id);
    }
}
